package com.xxc.hs.funActivity.panel;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.xxc.hs.R;

public class EelFaqDatabase extends SQLiteOpenHelper {
    private static final String DATABASE_NAME = "eel_faq_database.db";
    private static final int DATABASE_VERSION = 1;

    // 表名
    public static final String TABLE_QUESTIONS = "questions";
    public static final String TABLE_EXPERTS = "experts";
    public static final String TABLE_ANSWERS = "answers";

    // 问题表字段
    public static final String COLUMN_QUESTION_ID = "id";
    public static final String COLUMN_QUESTION_TITLE = "title";
    public static final String COLUMN_QUESTION_DESCRIPTION = "description";
    public static final String COLUMN_QUESTION_EXPERT_ID = "expert_id";
    public static final String COLUMN_QUESTION_IMAGE_ID = "image_id"; // 新增图片列


    // 专家表字段
    public static final String COLUMN_EXPERT_ID = "id";
    public static final String COLUMN_EXPERT_NAME = "name";
    public static final String COLUMN_EXPERT_TITLE = "title";
    public static final String COLUMN_EXPERT_RATING = "rating";
    public static final String COLUMN_EXPERT_CONSULT_COUNT = "consult_count";
    public static final String COLUMN_EXPERT_SKILLS = "skills";

    // 解答表字段
    public static final String COLUMN_ANSWER_ID = "id";
    public static final String COLUMN_ANSWER_QUESTION_ID = "question_id";
    public static final String COLUMN_ANSWER_CONTENT = "content";
    public static final String COLUMN_ANSWER_EXPERT_ID = "expert_id";


    // 构造函数
    public EelFaqDatabase(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // 创建问题表
        String createQuestionsTable = "CREATE TABLE " + TABLE_QUESTIONS + " (" +
                COLUMN_QUESTION_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                COLUMN_QUESTION_TITLE + " TEXT NOT NULL, " +
                COLUMN_QUESTION_DESCRIPTION + " TEXT, " +
                COLUMN_QUESTION_EXPERT_ID + " INTEGER NOT NULL, " +
                COLUMN_QUESTION_IMAGE_ID + " INTEGER NOT NULL)"; // 新增图片列

        // 创建专家表
        String createExpertsTable = "CREATE TABLE " + TABLE_EXPERTS + " (" +
                COLUMN_EXPERT_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                COLUMN_EXPERT_NAME + " TEXT NOT NULL, " +
                COLUMN_EXPERT_TITLE + " TEXT, " +
                COLUMN_EXPERT_RATING + " REAL, " +
                COLUMN_EXPERT_CONSULT_COUNT + " INTEGER, " +
                COLUMN_EXPERT_SKILLS + " TEXT)";

        // 创建解答表
        String createAnswersTable = "CREATE TABLE " + TABLE_ANSWERS + " (" +
                COLUMN_ANSWER_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                COLUMN_ANSWER_QUESTION_ID + " INTEGER NOT NULL, " +
                COLUMN_ANSWER_CONTENT + " TEXT NOT NULL, " +
                COLUMN_ANSWER_EXPERT_ID + " INTEGER NOT NULL, " +
                "FOREIGN KEY (" + COLUMN_ANSWER_QUESTION_ID + ") REFERENCES " +
                TABLE_QUESTIONS + " (" + COLUMN_QUESTION_ID + "), " +
                "FOREIGN KEY (" + COLUMN_ANSWER_EXPERT_ID + ") REFERENCES " +
                TABLE_EXPERTS + " (" + COLUMN_EXPERT_ID + "))";


        // 执行建表语句
        db.execSQL(createQuestionsTable);
        db.execSQL(createExpertsTable);
        db.execSQL(createAnswersTable);

        // 插入示例数据
        insertSampleData(db);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // 数据库升级时删除旧表并重建
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_QUESTIONS);
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_EXPERTS);
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_ANSWERS);
        onCreate(db);
    }

    // 插入示例数据
    public void insertSampleData(SQLiteDatabase db) {

        insert1(db);
        insert2(db);
        insert3(db);
        insert4(db);
        insert5(db);
        insert6(db);
        insert7(db);
        insert8(db);
        insert9(db);
        insert10(db);

    }

    private static void insert10(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "曹xx");
        expertValues.put(COLUMN_EXPERT_TITLE, "渔业教授");
        expertValues.put(COLUMN_EXPERT_RATING, 2.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 128);
        expertValues.put(COLUMN_EXPERT_SKILLS, "水产鱼类研究");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "车轮虫病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "鳃丝黏液增多，鳃丝发白、腐烂，体表出现白色小点状虫体，病鳝焦躁不安，常跳出水面，食欲减退，呼吸困难");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_chelunchong);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1. 保持水质清洁，定期用硫酸铜（0.5ppm）+ 硫酸亚铁（0.2ppm）全池泼洒\n" +
                "2. 苗种入池前用 8ppm 硫酸铜溶液浸浴 15~20 分钟\n" +
                "3. 全池泼洒硫酸铜与硫酸亚铁合剂（5:2，0.7ppm），24 小时后换水 1/3\n" +
                "4. 严重时重复用药一次，同时内服维生素 C 增强抵抗力");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

    private static void insert9(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "李xx");
        expertValues.put(COLUMN_EXPERT_TITLE, "鱼类教授");
        expertValues.put(COLUMN_EXPERT_RATING, 2.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 128);
        expertValues.put(COLUMN_EXPERT_SKILLS, "鱼类研究");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "毛细线虫病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "病鳝消瘦、贫血，摄食减少，生长缓慢，严重时死亡");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_maoxixianchong);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1. 定期清理残饵，避免水质恶化，减少虫卵滋生\n" +
                "2. 苗种放养前用 0.5ppm 晶体敌百虫全池泼洒\n" +
                "3. 内服阿苯达唑（每千克饲料添加 1~2g，连喂 5 天），或甲苯咪唑（每千克饲料 0.5g，连喂 3 天）\n" +
                "4. 同时全池泼洒硫酸铜（0.7ppm），杀灭水体中的幼虫");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

    private static void insert8(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "许x");
        expertValues.put(COLUMN_EXPERT_TITLE, "农业大学教授");
        expertValues.put(COLUMN_EXPERT_RATING, 2.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 128);
        expertValues.put(COLUMN_EXPERT_SKILLS, "黄鳝营养需求和配合饲料应用研究");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "棘头虫病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "病鳝肠道被虫体堵塞，黏膜充血、发炎，腹部膨大，食欲废绝");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_jitouchong);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1. 彻底清塘，杀灭中间宿主（如水蚤、甲壳类）\n" +
                "2. 投喂的活饵（如蚯蚓）需消毒处理（用 2% 食盐水浸浴 10 分钟）\n" +
                "3. 内服吡喹酮（每千克饲料添加 2~3g，连喂 3 天），或敌百虫（每千克饲料 0.5g，连喂 5 天）\n" +
                "4. 停药后用益生菌调理肠道，恢复消化功能");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

    private static void insert7(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "周x");
        expertValues.put(COLUMN_EXPERT_TITLE, "农业大学教授");
        expertValues.put(COLUMN_EXPERT_RATING, 2.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 128);
        expertValues.put(COLUMN_EXPERT_SKILLS, "黄鳝营养需求和配合饲料应用研究");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "打印病（腐皮病）");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "体表出现圆形或椭圆形溃烂灶，边缘充血，中间凹陷，似 “印章”");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_fupi);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1. 捞出病鳝，用棉签蘸取 3% 双氧水或 1% 高锰酸钾溶液涂抹溃疡处，每日 1 次，连续 3 天；重症者可涂抹红霉素软膏或磺胺类药物\n" +
                "2. 全池泼洒 0.5-0.8ppm 二氧化氯（每立方米水体 0.5-0.8 克），间隔 24 小时再用 1 次，杀灭水体病菌\n" +
                "3. 每亩水深 1 米用 60-80 公斤生石灰化水泼洒，提升 pH 至 7.5-8.5，兼具杀菌与水质改良作用\n" +
                "4. 每公斤饲料添加氟苯尼考 1.5 克或恩诺沙星 1 克，连续投喂 5-7 天（休药期 20 天），抑制体内细菌繁殖\n" +
                "5. 用五倍子、地榆各 5 克 / 公斤饲料煎汁拌料，每日 1 次，连用 3 天，收敛止血、促进皮肤修复\n" +
                "6. 饲料中添加维生素 C（3 克 / 公斤）和维生素 E（2 克 / 公斤），增强免疫力与皮肤再生能力。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

    private static void insert6(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "熊x");
        expertValues.put(COLUMN_EXPERT_TITLE, "农业大学食品科技学院教授");
        expertValues.put(COLUMN_EXPERT_RATING, 2.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 128);
        expertValues.put(COLUMN_EXPERT_SKILLS, "淡水鱼管理,水质管理,饲料配方");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "赤皮病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "体表皮肤充血、发炎，鳞片脱落，尤以腹部和两侧明显");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_chipi);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1. 及时捞出病鳝，用 1% 高锰酸钾溶液涂抹溃疡处，每日 1 次，连续 3 天\n" +
                "2. 全池泼洒，浓度 0.5-0.8ppm（每立方米水体 0.5-0.8 克），连用 2 天\n" +
                "3. 每公斤饲料添加氟苯尼考 1.5 克或恩诺沙星 1 克，连续投喂 5-7 天（休药期 20 天）\n" +
                "4. 每周换水 1/3，高温期增加至 1/2，保持水体透明度 30-40 厘米。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

    private static void insert5(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "邴xx");
        expertValues.put(COLUMN_EXPERT_TITLE, "水产科学研究院淡水渔业研究中心研究员");
        expertValues.put(COLUMN_EXPERT_RATING, 7.3);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 2528);
        expertValues.put(COLUMN_EXPERT_SKILLS, "黄鳝疾病诊断,黄鳝养殖");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "缺氧浮头");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "黄鳝集群水面，头部伸出水面呼吸，游动无力，严重时窒息死亡");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_futou);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1. 每周检测 1-2 次水质，重点关注溶氧量（建议安装在线溶氧监测仪，设定报警值≥4mg/L）\n" +
                "2. 每 15-20 天泼洒生石灰（每亩 1 米水深用 10-15 公斤） 调节 pH 值，同时使用微生物制剂（如光合细菌）维持水体生态平衡\n" +
                "3. 箱养殖中水草覆盖率保持在 60%-70%，避免水草过密导致夜间耗氧过高，及时清理腐烂水草\n" +
                "4. 池塘养殖按每 5 亩水面配备 1 台 3kW 增氧机，网箱养殖可在箱内放置纳米曝气盘（每箱 1-2 个），保证底层水体溶氧\n" +
                "5. 以黄鳝2 小时内吃完为标准，避免残饵堆积，每天投喂 1-2 次，高温期可减少投喂量。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

    private static void insert4(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "桂xx");
        expertValues.put(COLUMN_EXPERT_TITLE, "科学院院士");
        expertValues.put(COLUMN_EXPERT_RATING, 9.2);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 78988);
        expertValues.put(COLUMN_EXPERT_SKILLS, "鱼类生物技术，水产遗传育种");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "肠炎病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "黄鳝食欲减退，身体消瘦，离群独游，严重时腹部膨大、肛门红肿");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_changyan);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1.更换 1/2 新水，使用过硫酸氢钾（1-2ppm）改善底质，减少有害物质刺激肠道;\n " +
                "2.每公斤饲料添加恩诺沙星 1 克或氟苯尼考 1.5 克，连续投喂 5-7 天（休药期 20 天）;\n" +
                "3.发病初期停食 1-2 天，让肠道排空；恢复投喂时减至正常量的 1/3，逐步递增。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);
    }

    private static void insert3(SQLiteDatabase db) {
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "周xx");
        expertValues.put(COLUMN_EXPERT_TITLE, "淡水鱼产业技术体系综合试验站站长");
        expertValues.put(COLUMN_EXPERT_RATING, 4.2);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 388);
        expertValues.put(COLUMN_EXPERT_SKILLS, "水产养殖，鱼类营养");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "出血病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "体表、鳃盖、鳍条出现充血斑点，腹腔内有血水，肝脾肿大");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_chuxue);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1.每周换水 1/3，保持透明度 30-40 厘米，pH 值 7.5-8.5;\n " +
                "2.投放前用 3% 食盐水浸浴 5-10 分钟，或 0.1ppm 高锰酸钾溶液浸浴 15 分钟;\n" +
                "3.水泥池养殖密度不超过 5kg/m²，土池不超过 3kg/m²;\n" +
                "4.换水时温差不超过 2℃，避免在暴雨、闷热天气操作。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);
    }

    private static void insert2(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "杨xx");
        expertValues.put(COLUMN_EXPERT_TITLE, "xxx大学动物科学学院院长");
        expertValues.put(COLUMN_EXPERT_RATING, 6.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 268);
        expertValues.put(COLUMN_EXPERT_SKILLS, "水产养殖，鱼类营养，鱼病防治");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "水霉病（白毛病）");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "体表出现白色棉絮状菌丝，病灶处皮肤溃烂，食欲减退，活动迟缓...");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_shuimei);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "1.避免鱼体损伤：运输时使用镇静剂（如 MS-222），放养前用 3-5% 食盐水浸浴 5-10 分钟;\n " +
                "2.定期泼洒生石灰（20-30kg / 亩）调节 pH 至 7.5-8.5，保持溶氧＞5mg/L，降低有机物含量;\n" +
                "3.产卵池用 0.01% 孔雀石绿溶液浸浴鱼卵 10-15 分钟（但需注意孔雀石绿为禁用药物，部分地区推荐替代方案：1% 食盐 + 0.05% 小苏打混合液浸浴）。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);
    }

    private static void insert1(SQLiteDatabase db) {
        // 插入专家数据
        ContentValues expertValues = new ContentValues();
        expertValues.put(COLUMN_EXPERT_NAME, "张x");
        expertValues.put(COLUMN_EXPERT_TITLE, "农业科学院研究员");
        expertValues.put(COLUMN_EXPERT_RATING, 2.9);
        expertValues.put(COLUMN_EXPERT_CONSULT_COUNT, 128);
        expertValues.put(COLUMN_EXPERT_SKILLS, "黄鳝疾病诊断,水质管理,饲料配方,养殖环境优化");
        long expertId = db.insert(TABLE_EXPERTS, null, expertValues);

        // 插入问题数据
        ContentValues questionValues = new ContentValues();
        questionValues.put(COLUMN_QUESTION_TITLE, "黄鳝烂尾病");
        questionValues.put(COLUMN_QUESTION_DESCRIPTION, "黄鳝尾部出现溃烂，鳍条破损，严重时尾部肌肉腐烂...");
        questionValues.put(COLUMN_QUESTION_EXPERT_ID, expertId);
        questionValues.put(COLUMN_QUESTION_IMAGE_ID, R.drawable.hs_lanwei);
        long questionId = db.insert(TABLE_QUESTIONS, null, questionValues);

        // 插入解答数据
        ContentValues answerValues = new ContentValues();
        answerValues.put(COLUMN_ANSWER_QUESTION_ID, questionId);
        answerValues.put(COLUMN_ANSWER_CONTENT, "根据您描述的症状，黄鳝可能患有烂尾病。这是一种常见的细菌感染，通常由水质不良引起。建议您：\n" +
                "1. 立即更换部分养殖水，改善水质\n" +
                "2. 使用适量的消毒剂处理水体\n" +
                "3. 对患病黄鳝进行隔离，避免交叉感染\n" +
                "4. 在饲料中添加适量抗生素\n" +
                "如果症状持续，请及时联系专业兽医进行进一步诊断和治疗。");
        answerValues.put(COLUMN_ANSWER_EXPERT_ID, expertId);
        db.insert(TABLE_ANSWERS, null, answerValues);

    }

}